<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <h2>{{message}}</h2>
    <!-- 1.在遍历对象的过程中，如果只获取一个值，那么获取的是value-->
    <ul>
        <li v-for="item in info">{{item}}</li>
    </ul>

    <!-- 2.获取key和value 格式：(value, key)-->
    <ul>
        <li v-for="(value, key) in info">{{key}}:{{value}}</li>
    </ul>

    <!-- 实际应用场景较少-->
    <!-- 3.获取key和value和index 格式：(value, key, index)-->
    <ul>
        <li v-for="(value, key, index) in info">{{index + 1}}.{{key}}:{{value}}</li>
    </ul>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    const app = new Vue({
        el: '#app',
        data: {
            message: 'simplelu',
            info: {
                name: 'kai',
                age: 19
            }
        }
    })
</script>
</body>
</html>